home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************************/
- /* WhichWindow */
- /* This routine matches a WindowPtr with an entry in the window table windTbl, */
- /* returning the subscript of the entry. Return code is one if a match is not */
- /* found and zero if a match is found. */
- /************************************************************************************/
-
- #include "WhichWindow.h"
- #ifndef __C14__
- #include "PredatorPrey.h"
- #endif
-
- void WhichWindowSeg() {}
-
- short WhichWindow(WindowPtr WhichWindPtr, short * WhichSubscript)
- {
- short j;
- short WhichWindRetCode = 1; /* default return code is bad */
-
- for (j=0; j<windMax; j++) /* check the table for.. */
- if (WhichWindPtr == windTbl[j].windPtr) /* ..a match with pointer */
- { /* if there is a hit.. */
- *WhichSubscript = j;
- WhichWindRetCode = 0; /* set return code to good */
- break; /* get out of the loop */
- }
-
- return WhichWindRetCode;
- }